﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;

namespace Quizzer.Model
{
    public class Account : ModelBase<Account>
    {
        public string Username{ get; set; }
        public string Password{ get; set; }
        public Image Avatar{ get; set; }

        public bool IsAdmin{ get; set; }
    }

    public class Course : ModelBase<Course>
    {
        public DateTime CreationDate { get; set; }
        public string Title { get; set; }
        public string Description { get; set; }
    }

    public class Test : ModelBase<Test>
    {
        public Test()
        {
            NumberOfQuestions = 20;
            Attempts = 3;
        }

        public Guid CourseID{ get; set; }

        public string Title{ get; set; }
        public string Description{ get; set; }
        public int NumberOfQuestions{ get; set; }
        public int Attempts{ get; set; }
        public int Difficulty{ get; set; }
    }

    public class Question : ModelBase<Question>
    {
        public Question()
        {
            IsCheckBoxes = false;
            IsCustomAnswer = false;
            NumberOfAnswers = 4;
        }

        public Guid TestID{ get; set; }

        public bool IsCustomAnswer{ get; set; }
        public bool IsCheckBoxes{ get; set; }
        public string Description{ get; set; }
        public string Text{ get; set; }
        public Image Image{ get; set; }
        public int NumberOfAnswers{ get; set; }
    }

    public class Answer : ModelBase<Answer>
    {
        public Answer()
        {
            Weight = 1;
        }

        public Guid QuestionID{ get; set; }

        public float Weight{ get; set; }
        public string Text{ get; set; }
        public Image Image{ get; set; }
    }

    public class QuestionResult : ModelBase<QuestionResult>
    {
        public Guid AttemptID{ get; set; }
        public Guid QuestionID{ get; set; }

        public float AnswerWeight{ get; set; }
        public bool IsPositive{ get; set; }
    }

    public class Attempt : ModelBase<Attempt>
    {
        public Guid TestID{ get; set; }
        public Guid AccountID{ get; set; }

        public DateTime TestTime{ get; set; }
        public bool IsPositive{ get; set; }
        public float ResultWeight{ get; set; }
    }



    public class CourseAccount : ModelBase<CourseAccount>
    {
        public CourseAccount()
        {
            IsReadEnabled = true;
            IsDone = false;
            IsFavorite = false;
            IsCreator = false;
            IsEditEnabled = false;
        }

        public Guid AccountID{ get; set; }
        public Guid CourseID{ get; set; }

        public bool IsEditEnabled{ get; set; }
        public bool IsCreator{ get; set; }
        public bool IsFavorite{ get; set; }
        public bool IsDone{ get; set; }
        public bool IsReadEnabled{ get; set; }
    }

    public class AccountTest : ModelBase<AccountTest>
    {
        public AccountTest()
        {
            IsAccessible = true;
            IsDone = false;
            IsFailed = false;
        }

        public Guid AccountID{ get; set; }
        public Guid TestID{ get; set; }

        public bool IsAccessible{ get; set; }
        public bool IsDone{ get; set; }
        public bool IsFailed{ get; set; }
        public int AttemptsUsed{ get; set; }
    }
}
